/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package lab9;

/**
 *
 * @author mweya
 */
public class First implements Runnable {
    @Override
    public void run() {
        String[] names = {"John","Jane","Jon't", "Jo-Anne","Joe","James","Jamison","Jeremy","Jerome","Janice"};
        try{
            int j = 0;
            while (j<names.length){
                System.out.println(names[j]);
                j++;
            }
            Thread.sleep(5000);
        }
        // The name of the exception is e and the type is InterruptedException
        catch(InterruptedException e) {
            System.err.println(e.toString());
        }
        // Not sure if this counts as manipulation but this makes sure the thread
        // is working and not dead
        while(!Thread.currentThread().isInterrupted()){
            System.out.println("Not dead yet");
        }
        
    }
}